// 创建store对象

import { createStore, applyMiddleware, combineReducers } from 'redux'
import { composeWithDevTools } from 'redux-devtools-extension'

// 引入redux-thunk
import thunk from 'redux-thunk'
//引入reducer函数
import zsReducer from './reducer'
import lsReducer from '../lsRedux/reducer'

// 合并reducer, 返回值rootReducer就是合并之后的reducer函数
const rootReducer = combineReducers({
  zs: zsReducer,
  ls: lsReducer,
})

const store = createStore(
  rootReducer,
  composeWithDevTools(applyMiddleware(thunk)) //既可以使用中间件,又可以使用调试工具
)
export default store
